﻿'................................................
'.Esta clase esta hecha por tato (Santiago Eira).
'................................................
Imports System.Data
Imports System.Data.Odbc
Imports System.Data.OleDb
Imports System.Data.SqlClient

Public Class Llamado_categorias
    Public cn As OdbcConnection
    Public con As SqlConnection
    Function Altacategoria(ByVal nodo As Entidades.encapsuladora_categorias) As Boolean
        Try
            Try
                Dim cmd As OdbcCommand = New OdbcCommand("{call Altas_categorias (?)}", cn)
                cmd.CommandType = CommandType.StoredProcedure
                cmd.Parameters.AddWithValue("@nombrex", nodo.lol)
                cn.Open()
                cmd.ExecuteNonQuery()

            Catch o As OdbcException
                MsgBox(o.Message.ToString)
                Return False
            Finally
                cn.Close()
            End Try
            Return True

        Catch ex As Exception


        End Try
        Return False

    End Function
    Function Bajacategorias(ByVal nodo As Entidades.encapsuladora_categorias) As Boolean
        Try
            Try
                Dim cmd As OdbcCommand = New OdbcCommand("{call Bajas_categorias (?)}", cn)
                cmd.CommandType = CommandType.StoredProcedure
                cmd.Parameters.AddWithValue("@id", nodo.lol1)

                cn.Open()
                cmd.ExecuteNonQuery()

            Catch o As OdbcException
                MsgBox(o.Message.ToString)
                Return False
            Finally
                cn.Close()
            End Try
            Return True

        Catch ex As Exception


        End Try
        Return False

    End Function
    ' Function ModificacionProducto(ByVal nodo As Entidades.producto) As Boolean
    '    Try
    '       Try
    '  Dim cmd As OdbcCommand = New OdbcCommand("{call Modificacion_producto (?,?,?)}", cn)
    '      cmd.CommandType = CommandType.StoredProcedure
    '            cmd.Parameters.AddWithValue("@nomb", nodo.pid1)
    '            cmd.Parameters.AddWithValue("@pre", nodo.pid2)
    '            cmd.Parameters.AddWithValue("@id_ca", nodo.pid3)
    '
    '           cn.Open()
    '          cmd.ExecuteNonQuery()
    '
    '       Catch o As OdbcException
    '          MsgBox(o.Message.ToString)
    '         Return False
    '    Finally
    '       cn.Close()
    '  End Try
    ' Return True
    '
    '   Catch ex As Exception
    '
    '
    '   End Try
    '  Return False
    '
    ' End Function
End Class

